<template>
    <div>
         <table>
            <tr>
                <td>标题</td>
                <td>介绍</td>
                <td>图片</td>
                <td>分类名称</td>
            </tr>
            <tr v-for='i in list'>
                    <td>{{i.title}}</td>
                    <td>{{i.descrip}}</td>
                    <td><img :src='i.pic' width="200" height="250"></td>
                    <td>{{i.name}}</td>
                </tr>
        </table>
        <page1 :total='total' :page_size='page_size' @cpage="getpage"/>
    </div>
</template>

<script>
import page1 from '@/components/p7/page1'
    export default {
        components:{
            'page1':page1
        },
        data(){
            return{
                list:[],
                total:0,
                page_size:2,
                page:1
            }
        },
        methods:{
            getlist(){
                this.$axios.get('courseM?page='+this.page).then(res=>{
                    this.list = res.data.list
                    this.total = res.data.total
                })
            },
            getpage(p){
                this.page = p
                this.getlist()
            }
        },
        mounted(){
            this.getlist()
        }
    }
</script>

<style scoped>

</style>